/*
 * @Author: 江舟 jijiangzhou@recycloud.cn
 * @Date: 2024-03-26 14:58:25
 * @LastEditors: 江舟 jijiangzhou@recycloud.cn
 * @LastEditTime: 2024-05-08 17:36:19
 * @FilePath: \vite-project\src\apis\menu\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import http from 'utils/http';

/**
 * 查询菜单树列表
 * @param data.appId                应用ID
 * @param data.queryCondition       查询条件（名称）
 * @returns
 */
export const getMenuTree = (data: any) =>
    http({
        url: '/api/menu/queryMenuTree',
        method: 'post',
        data,
    });

/**
 * 查询子菜单
 * @param data.appId                应用ID
 * @param data.parentId            上级目录ID
 * @returns
 */
export const getMenuChildrenByParentId = (data: any) =>
    http({
        url: '/api/menu/listMenu',
        method: 'post',
        data,
    });

/**
 * 删除菜单
 * @param data.appId                应用ID
 * @param data.id                   菜单ID
 * @returns
 */
export const delMenu = (data: any) =>
    http({
        url: '/api/menu/delMenu',
        method: 'post',
        data,
    });

/**
 * 新增菜单
 * @param data.appId                应用ID
 * @param data.id                   菜单ID
 * @returns
 */
export const addMenu = (data: any) =>
    http({
        url: '/api/menu/addMenu',
        method: 'post',
        data,
    });

/**
 * 修改菜单
 * @param data.appId                应用ID
 * @param data.id                   菜单ID
 * @returns
 */
export const modifyMenu = (data: any) =>
    http({
        url: '/api/menu/modifyMenu',
        method: 'post',
        data,
    });
